<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path=request.getContextPath()+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=path %>" >
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<link rel="stylesheet" type="text/css" href="view/bootstrap-3.3.5/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="view/bootstrapvalidator/css/bootstrapValidator.css" />
<script charset="utf-8" src="view/jquery/jquery-1.10.2.min.js"></script>
<script charset="utf-8" src="view/bootstrap-3.3.5/js/bootstrap.js"></script>
<script charset="utf-8" src="view/bootstrapvalidator/js/bootstrapValidator.js"></script>
</head>
<body>
<center>
<div id="alertmsg" class="alert alert-dander"
			style="background-color: #66FFFF; color: red" hidden="true">
</div></center>
<br><br><br>
			
		<div class="container">
			<form action="login/denglu" role="form" class="form-horizontal"
				id="myform" method="post">
				<div class="form-group">
					<label for="username" class="col-md-4 control-label">账号</label>
					<div class="col-md-3">
						<input type="text" class="form-control" id="username"
							name="username" placeholder="请输入账号">
					</div>
				</div>
				<div class="form-group">
					<label for="password" class="col-md-4 control-label">密码</label>
					<div class="col-md-3">
						<input type="password" class="form-control" id="password"
							name="password" placeholder="请输入密码">
					</div>
				</div>
				<div class="form-group">
					<div class="col-md-offset-5">
						<input type="submit" class="btn btn-info" value="登录"> 
						<input type="reset" class="btn btn-default" id="reset" value="取消">
					</div>
				</div>
			</form>
			</div>
</body>
<script type="text/javascript">
	$(document).ready(function() {
          
		var str = "${requestScope.error}";
		if (str != null && str != "") {
			$("#alertmsg").text(str);
			$("#alertmsg").show();
			$("#alertmsg").delay(3000).hide(0);
		}
		
		$('#myform').bootstrapValidator({
			message : 'this value is not valid',
			feedbackIcons : {
				valid : 'glyphicon glyphicon-ok',
				invalid : 'glyphicon glyphicon-remove',
				validating : 'glyphicon glyphicon-refresh'
			},
			fields : {
				username : {

					validators : {

						notEmpty : {/*非空提示*/
							message : '用户名不能为空'
						}

					}

				},

				password : {

					validators : {

						notEmpty : {
							message : '密码不能为空'
						}	
				}

			},

			submitHandler : function(validator, form, submitButton) {
				validator.defaultsubmit();
			}
		},
	});


		$("#reset").click(function() {
			$('#myform').data("bootstrapValidator").resetForm();
		});
		
		
		$(function(){
			if(window!=top){
				top.location.href=location.href;
			}
		})
	});
</script>
</html>